<template>
  <div class="main">
    <div class="home">
      <div class="title">
        Jenkins
      </div>
      <div class="menu">
        <el-menu
            :collapse="isCollapse"
            class="el-menu-vertical-demo"
            default-active="1"
            @close="handleClose"
            @open="handleOpen">
          <el-menu-item index="1">
            <el-icon>
              <icon-menu/>
            </el-icon>
            <template #title>Jenkins项目汇总</template>
          </el-menu-item>
          <el-menu-item index="2">
            <el-icon>
              <PictureRounded/>
            </el-icon>
            <template #title>前端项目</template>
          </el-menu-item>
          <el-menu-item index="3">
            <el-icon>
              <Monitor/>
            </el-icon>
            <template #title>后端项目</template>
          </el-menu-item>
          <el-menu-item index="4">
            <el-icon>
              <ChromeFilled/>
            </el-icon>
            <template #title>创建项目</template>
          </el-menu-item>
          <el-menu-item index="5">
            <el-icon>
              <Coin/>
            </el-icon>
            <template #title>git仓库配置</template>
          </el-menu-item>
          <el-menu-item index="6">
            <el-icon>
              <Compass/>
            </el-icon>
            <template #title>服务器状态</template>
          </el-menu-item>
        </el-menu>
      </div>
    </div>
  </div>
</template>

<script setup>
import {ref} from 'vue'
import {ChromeFilled, Coin, Compass, Menu as IconMenu, Monitor, PictureRounded,} from '@element-plus/icons-vue'

const isCollapse = ref(false)
const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>

<style lang="scss" scoped>
.main {
  display: flex;
  width: 180px;
  height: 98vh;
  //border: 1px solid red;
  padding: 5px;
  background-color: rgb(245, 245, 249);
  text-align: center;

  .home {
    display: flex;
    flex-direction: column;
    //border: 1px solid red;
    flex: 1;
    background-color: rgb(255, 255, 255);

    .title {
      //border: 1px solid red;
      align-items: center;
      justify-content: center;
      display: flex;
      width: 100%;
      height: 10%;
      background-color: rgb(255, 255, 255);
      font-size: 25px;
      color: rgb(88, 107, 128);
    }

    .menu {
      display: flex;
      //border: 1px solid red;
      margin-top: 10px;
      width: 100%;
      height: calc(99vh - 10% - 20px);
    }
  }
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 180px;
  min-height: 180px;
}

.el-menu{
  border-right: transparent;
}
</style>